using System;

namespace Genko.Model
{
	[AttributeUsage(AttributeTargets.Property, Inherited=true)]
	public class MemberAttributeAttribute : Attribute
	{
		private string name = null;
		private string customType = null;
		private Type dataType = null;

		public MemberAttributeAttribute()
		{

		}

		public MemberAttributeAttribute(string customType)
		{
			this.customType = customType;
		}

		public MemberAttributeAttribute(string customType, string name)
		{
			this.name = name;
			this.customType = customType;
		}

		public MemberAttributeAttribute(Type dataType)
		{
			this.dataType = dataType;
		}

		public MemberAttributeAttribute(Type dataType, string name)
		{
			this.name = name;
			this.dataType = dataType;
		}

		public string Name
		{
			get
			{
				return name;
			}
		}

		public string CustomType
		{
			get
			{
				return customType;
			}
		}

		public bool IsCustom
		{
			get
			{
				return !string.IsNullOrEmpty(customType);
			}
		}

		public Type DataType
		{
			get
			{
				return this.dataType;
			}
		}
	}
}
